package com.xgst.bmg.server.manager;
/**
 * @Author: xgstjs-11
 * @CreateTime: 2021-03-09 14:34:03
 * @Description:
 */


import com.xgst.bmg.server.entities.Stream;
import com.xgst.bmg.server.entities.StreamName;

import java.util.concurrent.ConcurrentHashMap;

/**
 * all stream info store here,including publisher and subscriber and their live type video & audio
 *
 */
public class StreamManager {
	private ConcurrentHashMap<StreamName, Stream> streams=new ConcurrentHashMap<>();
	
	public void newStream(StreamName streamName,Stream s) {
		streams.put(streamName, s);
	}
	
	public boolean exist(StreamName streamName) {
		return streams.containsKey(streamName);
	}
	
	public Stream getStream(StreamName streamName) {
		return streams.get(streamName);
	}
	
	public void remove(StreamName streamName) {
		streams.remove(streamName);
	}
}

